home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-16 | 3.4 KB | 116 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: Select.cpp
- // Release Version: $ ODF 1 $
- //
- // Author: M.Boetcher
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "Embed.hpp"
-
- #ifndef SELECT_H
- #include "Select.h"
- #endif
-
- #ifndef PROXY_H
- #include "Proxy.h"
- #endif
-
- #ifndef CONTENT_H
- #include "Content.h"
- #endif
-
- // ----- Framework Includes -----
-
- #ifndef FWPRESEN_H
- #include "FWPresen.h"
- #endif
-
- //========================================================================================
- // Runtime information
- //========================================================================================
-
- #ifdef FW_BUILD_MAC
- #pragma segment odfembed
- #endif
-
- FW_DEFINE_AUTO(CEmbedSelection)
-
- //========================================================================================
- // CLASS CEmbedSelection
- //========================================================================================
-
- //---------------------------------------------------------------------------------------
- // CEmbedSelection constructor
- //---------------------------------------------------------------------------------------
-
- CEmbedSelection::CEmbedSelection(Environment* ev, CEmbedContent* content) :
- FW_CSelection(ev, false, false),
- fContent(content)
- {
- }
-
- //---------------------------------------------------------------------------------------
- // CEmbedSelection destructor
- //---------------------------------------------------------------------------------------
-
- CEmbedSelection::~CEmbedSelection()
- {
- }
-
- //---------------------------------------------------------------------------------------
- // CEmbedSelection::CloseSelection
- //---------------------------------------------------------------------------------------
-
- void CEmbedSelection::CloseSelection(Environment* ev)
- {
- // Nothing to do
- }
-
- //---------------------------------------------------------------------------------------
- // CEmbedSelection::ClearSelection
- //---------------------------------------------------------------------------------------
-
- void CEmbedSelection::ClearSelection(Environment* ev)
- {
- CEmbedProxy* proxy = fContent->GetProxy();
-
- if (proxy) // there is an embedded part - don't delete it, because this action might be undone
- {
- proxy->SetSelectState(ev, false);
- proxy->DetachEmbeddedFrames(ev);
- fContent->SetProxy(NULL);
- GetPresentation(ev)->Invalidate(ev);
- }
- }
-
- //---------------------------------------------------------------------------------------
- // CEmbedSelection::SelectAll
- //---------------------------------------------------------------------------------------
-
- void CEmbedSelection::SelectAll(Environment* ev)
- {
- // Nothing to do
- }
-
- //---------------------------------------------------------------------------------------
- // CEmbedSelection::IsEmpty
- //---------------------------------------------------------------------------------------
-
- FW_Boolean CEmbedSelection::IsEmpty(Environment* ev) const
- {
- return (fContent->GetProxy() == NULL);
- }
-
- //---------------------------------------------------------------------------------------
- // CEmbedSelection::GetSelectedContent
- //---------------------------------------------------------------------------------------
-
- FW_CContent* CEmbedSelection::GetSelectedContent(Environment* ev)
- {
- return fContent;
- }
-